package org.jet.emall.rbac.po;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 后台操作日志表
 * </p>
 *
 * @author xiaozai
 * @since 2020-04-05
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("tb_admin_op_log")
@ApiModel(value="AdminOpLog对象", description="后台操作日志表")
public class AdminOpLog implements Serializable {

    private static final long serialVersionUID=1L;

    @ApiModelProperty(value = "自增主键")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "用户id")
    private Integer userId;

    @ApiModelProperty(value = "用户名")
    private String username;

    @ApiModelProperty(value = "角色id")
    private Integer roleId;

    @ApiModelProperty(value = "角色名")
    private String roleName;

    @ApiModelProperty(value = "操作类型:  1-新增; 2-修改; 3-删除")
    private Byte opType;

    @ApiModelProperty(value = "类名")
    private String className;

    @ApiModelProperty(value = "调用的api方法名称")
    private String method;

    @ApiModelProperty(value = "接收参数")
    private String args;

    @ApiModelProperty(value = "请求url")
    private String reqUrl;

    @ApiModelProperty(value = "api的功能描述")
    private String func;

    @ApiModelProperty(value = "成功与否: 1-成功; 0-失败")
    private Byte success;

    @ApiModelProperty(value = "返回结果，为了节省存储空间不包含数据，只包含返回码和返回消息")
    private String returnResult;

    @ApiModelProperty(value = "api所属菜单")
    private String menu;

    @ApiModelProperty(value = "用户的ip地址,最长ipv6的长度")
    private String ip;

    @ApiModelProperty(value = "浏览器类型")
    private String userAgent;

    @ApiModelProperty(value = "操作花费时长,以豪秒计")
    private Integer spendTime;

    @ApiModelProperty(value = "操作开始时间")
    private LocalDateTime opTime;


}
